package com.tailyou.androidlearning202400.kl

//类：手机
//定义类的结构,属性,行为
//class Phone(var brand: String, var model: String) {
//class Phone {
open class Phone {
    //属性（字段）
    //lateinit var brand: String  //赋值
    //var model:String = ""   //不赋值
    var brand: String = ""
    var model:String = ""

    //空参构造函数
    constructor()

    //部分参数构造函数
    constructor(brand: String){
        this.brand = brand
    }

    //全参构造函数
    constructor(brand:String,model:String) {
        //this.brand = brand
        this.model = model
    }


    //行为（方法）
    fun call(name: String){
//        println("用$brand $model 手机给$name 打电话")
        println("用${brand}${model}手机给${name}打电话")
    }
}
